#pragma once
#include <iostream>
#include <thread>
#include "level.hpp"
#include "util.hpp"
namespace logs
{
    // 日志主体包含：时间、日志等级、文件、错误所在行数、消息主体、线程ID、日志器的名字
    struct logMsg
    {
        logMsg() {}
        logMsg(
            LogLevel::Value level,
            size_t line,
            const std::string &file,
            const std::string &msg,
            const std::string &logger)
            : _tid(std::this_thread::get_id()),
              _ctime(util::Data::getTime()),
              _line(line),
              _file(file),
              _payload(msg),
              _logger(logger),
              _level(level)
        {
        }

        time_t _ctime;
        size_t _line;
        std::thread::id _tid;
        std::string _file;
        std::string _payload;
        std::string _logger;
        LogLevel::Value _level;
    };
}